﻿<%@ Page Language="C#" MasterPageFile="~/admin/MasterPage_Admin.master" AutoEventWireup="true"
    CodeFile="ads_add.aspx.cs" ValidateRequest="false" Inherits="admin_ads_add" Title="IT110：不良信息举报与检索平台 - 广告信息管理 - By ECountry.Ltd" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder_Search" runat="Server">
    <div class="w-sjzzbb">
        <div class="w-sjzztop">
            广告管理中心
        </div>
    </div>
    <div style="border:1px solid #09f;text-align:left;padding:10px">
        <p style="font-size:17px;text-align:center">综合广告信息管理中心</p>
    广告位置:<asp:DropDownList ID="DropDownList_type" runat="server" AutoPostBack="True"
        DataSourceID="ObjectDataSource_Ads_Type" DataTextField="position" DataValueField="id"
        AppendDataBoundItems="True">
        <asp:ListItem Selected="True" Value="0">= 请选择广告位置 =</asp:ListItem>
    </asp:DropDownList>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DropDownList_type"
        ErrorMessage="请选择正确的广告位置" InitialValue="0">*请选择正确的广告位置</asp:RequiredFieldValidator>
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
        ShowSummary="False" />
    <asp:ObjectDataSource ID="ObjectDataSource_Ads_Type" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="Get_Data_Order_By_Id" TypeName="DataSet_fp_ads_DyhTableAdapters.Dyh_ADS_positionTableAdapter">
    </asp:ObjectDataSource>
    <asp:FormView ID="FormView2" runat="server" DataKeyNames="id" DataSourceID="ObjectDataSource2"
        Width="100%">
        <ItemTemplate>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
                <tr class="altbg1">
                    <td width="12%">
                        广告信息
                    </td>
                    <td colspan="3">
                        位置：<asp:Label ID="Label2" runat="server" Text='<%# Eval("position") %>' Font-Bold="True"></asp:Label><br>
                        规格：<asp:Label ID="Label_width" runat="server" Text='<%# Eval("width") %>' Font-Bold="True"></asp:Label>×<asp:Label
                            ID="Label_height" runat="server" Text='<%# Eval("height")%>' Font-Bold="True"></asp:Label>
                        px (用于图片和flash)<br>
                        收费标准：<asp:Label ID="Label3" runat="server" Text='<%# Eval("cost") %>' Font-Bold="True"></asp:Label>
                        RMB/月<br />
                        说明：<%# Eval("description") %>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:FormView>
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="Get_Data_By_Id_For_Admin" TypeName="DataSet_fp_ads_DyhTableAdapters.Dyh_ADS_positionTableAdapter">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList_type" Name="id" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <%--<br>
    --%>
    <asp:FormView ID="FormView1" runat="server" DataKeyNames="id" DataSourceID="ObjectDataSource1"
        DefaultMode="Insert" Width="100%" OnDataBound="FormView1_DataBound" OnItemInserted="FormView1_ItemInserted"
        OnItemInserting="FormView1_ItemInserting">
        <%--<EditItemTemplate>
                </EditItemTemplate>--%>
        <InsertItemTemplate>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
                <tr class="altbg1">
                    <td>
                        广告类型：
                    </td>
                    <td colspan="3">
                        <asp:RadioButtonList ID="RadioButtonList_type" runat="server" RepeatDirection="Horizontal"
                            SelectedValue='<%# Bind("type") %>' OnSelectedIndexChanged="RadioButtonList_type_SelectedIndexChanged"
                            AutoPostBack="True" Width="320">
                            <asp:ListItem Value="1" Selected="True">图片</asp:ListItem>
                            <asp:ListItem Value="2">Flash</asp:ListItem>
                            <asp:ListItem Value="3">文字</asp:ListItem>
                            <asp:ListItem Value="4">代码 
                            </asp:ListItem>
                        </asp:RadioButtonList>
                        <%--     
      <input class=radio name="open" type=radio value=true <%if r("open")=true then%>checked<%end if%>>
        是
        <input class=radio name="open" type=radio value=false <%if r("open")=false then%>checked<%end if%>>
        否--%>
                    </td>
                </tr>
                <tr class="altbg1">
                    <td>
                        是否开放：
                    </td>
                    <td colspan="3">
                        <asp:RadioButtonList ID="RadioButtonList2" runat="server" RepeatDirection="Horizontal"
                            SelectedValue='<%# Bind("Isopen") %>' Width="150">
                            <asp:ListItem Value="True">是</asp:ListItem>
                            <asp:ListItem Value="False" Selected="True">否</asp:ListItem>
                        </asp:RadioButtonList>
                        <%--     
      <input class=radio name="open" type=radio value=true <%if r("open")=true then%>checked<%end if%>>
        是
        <input class=radio name="open" type=radio value=false <%if r("open")=false then%>checked<%end if%>>
        否--%>
                    </td>
                </tr>
                <asp:Panel ID="Panel_address" runat="server">
                    <tr>
                        <%--id="ads_address" runat="server"--%>
                        <td>
                            广告地址：
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txtoraddressTextBox" runat="server" Columns="25" style="border:1px solid #09f" Text='<%# Bind("txtoraddress") %>'
                                Height="20px" />
                            <asp:FileUpload ID="MyFileUpload" runat="server" Height="24px" />
                            <asp:Button ID="Button_fileUpload" runat="server" OnClick="Button_fileUpload_Click"
                                Text="上传"  BackColor="#0099ff" ForeColor="#ffffff" style="padding:3px 8px;border:0"/>
                            <asp:Label ID="Label_Msg" runat="server"></asp:Label>
                            <br>
                            **图片地址或文字内容,(分页广告地址必须加“<span class="style1">../</span>”)
                        </td>
                    </tr>
                </asp:Panel>
                <asp:Panel ID="Panel_url" runat="server">
                    <tr>
                        <%--id="ads_url" runat=server--%>
                        <td>
                            广告链接：
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="urlTextBox" runat="server" Columns="60" style="border:1px solid #09f" Text='<%# Bind("url") %>' />
                            <br>
                            **图片和文字的链接,flash和自写代码不用填
                        </td>
                    </tr>
                </asp:Panel>
                <asp:Panel ID="Panel_code" runat="server">
                    <tr>
                        <%--id="ads_code" runat=server--%>
                        <td>
                            自写代码：
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="TextBox3" runat="server" Columns="70" style="border:1px solid #09f" Rows="5" Text='<%# Bind("content") %>'
                                TextMode="MultiLine" /><br>
                            **只用于自写代码。
                        </td>
                    </tr>
                </asp:Panel>
                <%--<tr class="altbg1">
      <td>广告大小：</td><td colspan="3"> 长
        宽
        只用于图片和flash,其他不用填。</td>
    </tr>--%>
                <tr class="altbg1">
                    <td>
                        广告说明：
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="TextBox4" runat="server" Columns="58" style="border:1px solid #09f" Text='<%# Bind("note") %>' />
                        &nbsp;
                    </td>
                </tr>
                <%--    <tr class="altbg1">
      <td>收费标准：</td><td colspan="3">
      　</td>
    </tr>
                --%>
                <tr class="altbg1">
                    <td>
                        是否已租：
                    </td>
                    <td colspan="3">
                        <asp:RadioButtonList ID="RadioButtonList3" runat="server" RepeatDirection="Horizontal"
                            SelectedValue='<%# Bind("Issale") %>'>
                            <asp:ListItem Value="True">是</asp:ListItem>
                            <asp:ListItem Value="False" Selected="True">否</asp:ListItem>
                        </asp:RadioButtonList>
                        <%--      <input class=radio name="sale" type=radio value=true <%if r("sale")=true then%>checked<%end if%>>
        是
        <input class=radio name="sale" type=radio value=false <%if r("sale")=false then%>checked<%end if%>>
        否--%>
                    </td>
                </tr>
                <tr class="altbg1">
                    <td>
                        租用时间：
                    </td>
                    <td colspan="3">
                        <%--<Input class=button onClick="fPopUpCalendarDlg(starttime);return false" type=button value="选择" name=Submit>--%>
                        <%--<input name="starttime" type="text" id="starttime" value="<%=r("starttime")%>" size="12" id=name3 >--%>
                        <asp:TextBox ID="TextBox5" runat="server" style="border:1px solid #09f" Text='<%# Bind("starttime") %>' Columns="20" />
                        至
                        <%--<input name="endtime" type="text" id="endtime" value="<%=r("endtime")%>" size="12">--%>
                        <%--<Input  class=button onClick="fPopUpCalendarDlg(endtime);return false" type=button value="选择" name=Submit>--%>
                        <asp:TextBox ID="TextBox6" runat="server" style="border:1px solid #09f" Text='<%# Bind("endtime") %>' Columns="20" />
                    </td>
                </tr>
                <tr class="altbg1">
                    <td>
                        <%--<a class=button href="ads_manage.aspx">返回管理</a>--%>
                    </td>
                    <td colspan="3">
                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                            Text="确认插入" BackColor="#0099ff" ForeColor="#ffffff" style="padding:5px 8px" />
                        &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
                            CommandName="Cancel" Text="重新设定"  BackColor="#0099ff" ForeColor="#ffffff" style="padding:5px 8px"/>
                    </td>
                </tr>
                <!--    <tr class="header">
      <td colspan="4">其它选项：</td></tr>
    <tr class="altbg1">
      <td colspan="4"><a class=button href="?action=del&n=<%--<%=n%>--%>">删除该广告</a> <a class=button href="?action=makejs&n=<%--<%=n%>--%>">生成广告Ｊｓ</a></td>
    </tr>
    <tr class="altbg1">
      <td colspan="4">
  该广告的Js调用代码（使用JS调用广告时将下面的代码添加到相应位置即可，使用广告标签时则忽略此项）</td>
     </tr>
   <tr class="altbg1">
<td colspan="4">  

<input name="adjs" type="text" id="adjs" value='<script language=javascript src="http://<%--<%=Request.ServerVariables("HTTP_HOST")%>--%>/js/adurl<%--<%=n%>--%>.js"></script>' size="100" onMouseOver="this.focus()" onFocus="this.select()">
<input type="button" class="button" name="getcode" value="复制代码" onclick="JM_cc('adjs')">

    </tr>-->
            </table>
        </InsertItemTemplate>
    </asp:FormView>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" InsertMethod="Insert_New_Data_Query"
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="DataSet_fp_ads_DyhTableAdapters.Dyh_ADTableAdapter">
        <InsertParameters>
            <asp:Parameter Name="positionid" Type="Int32" />
            <asp:Parameter Name="type" Type="Byte" />
            <asp:Parameter Name="content" Type="String" />
            <asp:Parameter Name="note" Type="String" />
            <asp:Parameter Name="Issale" Type="Boolean" />
            <asp:Parameter Name="Isopen" Type="Boolean" />
            <asp:Parameter Name="starttime" Type="DateTime" />
            <asp:Parameter Name="endtime" Type="DateTime" />
            <asp:Parameter Name="tag" Type="String" />
            <asp:Parameter Name="url" Type="String" />
            <asp:Parameter Name="txtoraddress" Type="String" />
            <asp:Parameter Name="times" Type="Int32" />
            <asp:Parameter Name="userid" Type="Int32" />
        </InsertParameters>
    </asp:ObjectDataSource>
    <%--          </ContentTemplate>
    </asp:UpdatePanel>
    --%>
    </div>
</asp:Content>
